package com.weixing.mall.provider.support.excaldata;


import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.weixing.mall.base.constant.GlobalConstant;
import lombok.Data;

import java.net.MalformedURLException;
import java.net.URL;

@Data
public class InDepotProductED {
    @ExcelProperty("图片")
    @ExcelIgnore
    private String img;
    @ExcelProperty("图片")
    private URL imgUrl;
    @ExcelProperty("仓库名称")
    private String depotName;
    @ExcelProperty("入库单号")
    private String billSn;
    @ExcelProperty("商品名称")
    private String goodsName;
    @ExcelProperty("货号")
    private String productSn;
    @ExcelProperty("款号")
    private String styleNo;
    @ExcelProperty("颜色/尺码")
    @ExcelIgnore
    private String sku;
    @ExcelProperty("尺码")
    private String size;
    @ExcelProperty("颜色")
    private  String color;
    @ExcelProperty("数量")
    private Integer quantity;
    @ExcelProperty("库位")
    private String storehouse;

    public void setImg(String img){
        this.img = img;
        try {
            if (StrUtil.isNotEmpty(img)){
                this.imgUrl =new URL(GlobalConstant.IMG_PATH_URL +img+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}
